Better Termination for Prolog with Constraints
نویسندگان
چکیده
Termination properties of actual Prolog systems with constraints are fragile and difficult to analyse. The lack of the occurs-check, moded and overloaded arithmetical evaluation via is/2 and the occasional nontermination of finite domain constraints are all sources for invalidating termination results obtained by current termination analysers that rely on idealized assumptions. In this paper, we present solutions to address these problems on the level of the underlying Prolog system. Improved unification modes meet the requirements of norm based analysers by offering dynamic occurs-check detection. A generalized finite domain solver overcomes the shortcomings of conventional arithmetic without significant runtime overhead. The solver offers unbounded domains, yet propagation always terminates. Our work improves Prolog’s termination and makes Prolog a more reliable target for termination and type analysis. It is part of SWI-Prolog since version 5.6.50.
منابع مشابه
Checking Termination of Queries to Logic Programs
Termination of programs is known to be undecidable. However in the case of logic programs , where the only possible cause for non-termination is innnite recursion, termination can actually be proved automatically for a large class of programs. This paper describes an algorithm for automatically checking termination of queries to logic programs. Given a program and query the algorithm either ans...
متن کاملA Transformational Approach for Proving Properties of the CHR Constraint Store
Proving termination of, or generating efficient control for Constraint Handling Rules (CHR) programs requires information about the kinds of constraints that can show up in the CHR constraint store. In contrast to Logic Programming (LP), there are not many tools available for deriving such information for CHR. Hence, instead of building analyses for CHR from scratch, we define a transformation ...
متن کاملA Semantic Basis for the Termination Analysis of Logic Programs
This paper presents a formal semantic basis for the termination analysis of logic programs. The semantics exhibits the termination properties of a logic program through its binary unfoldings | a possibly innnite set of binary clauses. Termination of a program P and goal G is determined by the absence of an innnite chain in the binary unfoldings of P starting with G. The result is of practical u...
متن کاملApplying Constraint Handling Rules to HPSG
Constraint Handling Rules (CHR) have provided a realistic solution to an over-arching problem in many elds that deal with constraint logic programming: how to combine recursive functions or relations with constraints while avoiding non-termination problems. This paper focuses on some other bene ts that CHR, speci cally their implementation in SICStus Prolog, have provided to computational lingu...
متن کاملAutomated termination analysis for logic programs with cut
Termination is an important and well-studied property for logic programs. However, almost all approaches for automated termination analysis focus on definite logic programs, whereas real-world Prolog programs typically use the cut operator. We introduce a novel pre-processing method which automatically transforms Prolog programs into logic programs without cuts, where termination of the cut-fre...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/0903.2168 شماره
صفحات -
تاریخ انتشار 2008